// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod identity_aware_proxy_admin_service {
    use crate::Result;

    /// A builder for [IdentityAwareProxyAdminService][crate::client::IdentityAwareProxyAdminService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_iap_v1::*;
    /// # use builder::identity_aware_proxy_admin_service::ClientBuilder;
    /// # use client::IdentityAwareProxyAdminService;
    /// let builder : ClientBuilder = IdentityAwareProxyAdminService::builder();
    /// let client = builder
    ///     .with_endpoint("https://iap.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::IdentityAwareProxyAdminService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = IdentityAwareProxyAdminService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::IdentityAwareProxyAdminService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::set_iam_policy][crate::client::IdentityAwareProxyAdminService::set_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::SetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);

    impl SetIamPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::Policy> {
            (*self.0.stub)
                .set_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
        ///
        /// This is a **required** field for requests.
        pub fn set_policy<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<iam_v1::model::Policy>,
        {
            self.0.request.policy = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<iam_v1::model::Policy>,
        {
            self.0.request.policy = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::get_iam_policy][crate::client::IdentityAwareProxyAdminService::get_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::GetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);

    impl GetIamPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::Policy> {
            (*self.0.stub)
                .get_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
        pub fn set_options<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
        {
            self.0.request.options = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
        {
            self.0.request.options = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::test_iam_permissions][crate::client::IdentityAwareProxyAdminService::test_iam_permissions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::TestIamPermissions;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TestIamPermissions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);

    impl TestIamPermissions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
            (*self.0.stub)
                .test_iam_permissions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
        ///
        /// This is a **required** field for requests.
        pub fn set_permissions<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TestIamPermissions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::get_iap_settings][crate::client::IdentityAwareProxyAdminService::get_iap_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::GetIapSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIapSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIapSettings(RequestBuilder<crate::model::GetIapSettingsRequest>);

    impl GetIapSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetIapSettingsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IapSettings> {
            (*self.0.stub)
                .get_iap_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetIapSettingsRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIapSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::update_iap_settings][crate::client::IdentityAwareProxyAdminService::update_iap_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::UpdateIapSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateIapSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateIapSettings(RequestBuilder<crate::model::UpdateIapSettingsRequest>);

    impl UpdateIapSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateIapSettingsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IapSettings> {
            (*self.0.stub)
                .update_iap_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [iap_settings][crate::model::UpdateIapSettingsRequest::iap_settings].
        ///
        /// This is a **required** field for requests.
        pub fn set_iap_settings<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IapSettings>,
        {
            self.0.request.iap_settings = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [iap_settings][crate::model::UpdateIapSettingsRequest::iap_settings].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_iap_settings<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IapSettings>,
        {
            self.0.request.iap_settings = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateIapSettingsRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateIapSettingsRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateIapSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::validate_iap_attribute_expression][crate::client::IdentityAwareProxyAdminService::validate_iap_attribute_expression] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::ValidateIapAttributeExpression;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ValidateIapAttributeExpression {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ValidateIapAttributeExpression(
        RequestBuilder<crate::model::ValidateIapAttributeExpressionRequest>,
    );

    impl ValidateIapAttributeExpression {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ValidateIapAttributeExpressionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ValidateIapAttributeExpressionResponse> {
            (*self.0.stub)
                .validate_iap_attribute_expression(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::ValidateIapAttributeExpressionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [expression][crate::model::ValidateIapAttributeExpressionRequest::expression].
        ///
        /// This is a **required** field for requests.
        pub fn set_expression<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.expression = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ValidateIapAttributeExpression {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::list_tunnel_dest_groups][crate::client::IdentityAwareProxyAdminService::list_tunnel_dest_groups] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::ListTunnelDestGroups;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListTunnelDestGroups {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListTunnelDestGroups(RequestBuilder<crate::model::ListTunnelDestGroupsRequest>);

    impl ListTunnelDestGroups {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListTunnelDestGroupsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListTunnelDestGroupsResponse> {
            (*self.0.stub)
                .list_tunnel_dest_groups(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListTunnelDestGroupsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListTunnelDestGroupsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListTunnelDestGroupsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListTunnelDestGroupsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListTunnelDestGroupsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListTunnelDestGroups {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::create_tunnel_dest_group][crate::client::IdentityAwareProxyAdminService::create_tunnel_dest_group] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::CreateTunnelDestGroup;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateTunnelDestGroup {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateTunnelDestGroup(RequestBuilder<crate::model::CreateTunnelDestGroupRequest>);

    impl CreateTunnelDestGroup {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateTunnelDestGroupRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TunnelDestGroup> {
            (*self.0.stub)
                .create_tunnel_dest_group(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateTunnelDestGroupRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [tunnel_dest_group][crate::model::CreateTunnelDestGroupRequest::tunnel_dest_group].
        ///
        /// This is a **required** field for requests.
        pub fn set_tunnel_dest_group<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TunnelDestGroup>,
        {
            self.0.request.tunnel_dest_group = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [tunnel_dest_group][crate::model::CreateTunnelDestGroupRequest::tunnel_dest_group].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_tunnel_dest_group<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TunnelDestGroup>,
        {
            self.0.request.tunnel_dest_group = v.map(|x| x.into());
            self
        }

        /// Sets the value of [tunnel_dest_group_id][crate::model::CreateTunnelDestGroupRequest::tunnel_dest_group_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_tunnel_dest_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.tunnel_dest_group_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateTunnelDestGroup {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::get_tunnel_dest_group][crate::client::IdentityAwareProxyAdminService::get_tunnel_dest_group] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::GetTunnelDestGroup;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetTunnelDestGroup {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetTunnelDestGroup(RequestBuilder<crate::model::GetTunnelDestGroupRequest>);

    impl GetTunnelDestGroup {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetTunnelDestGroupRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TunnelDestGroup> {
            (*self.0.stub)
                .get_tunnel_dest_group(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetTunnelDestGroupRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetTunnelDestGroup {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::delete_tunnel_dest_group][crate::client::IdentityAwareProxyAdminService::delete_tunnel_dest_group] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::DeleteTunnelDestGroup;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteTunnelDestGroup {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteTunnelDestGroup(RequestBuilder<crate::model::DeleteTunnelDestGroupRequest>);

    impl DeleteTunnelDestGroup {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteTunnelDestGroupRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_tunnel_dest_group(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteTunnelDestGroupRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteTunnelDestGroup {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyAdminService::update_tunnel_dest_group][crate::client::IdentityAwareProxyAdminService::update_tunnel_dest_group] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_admin_service::UpdateTunnelDestGroup;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateTunnelDestGroup {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateTunnelDestGroup(RequestBuilder<crate::model::UpdateTunnelDestGroupRequest>);

    impl UpdateTunnelDestGroup {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyAdminService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateTunnelDestGroupRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TunnelDestGroup> {
            (*self.0.stub)
                .update_tunnel_dest_group(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [tunnel_dest_group][crate::model::UpdateTunnelDestGroupRequest::tunnel_dest_group].
        ///
        /// This is a **required** field for requests.
        pub fn set_tunnel_dest_group<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TunnelDestGroup>,
        {
            self.0.request.tunnel_dest_group = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [tunnel_dest_group][crate::model::UpdateTunnelDestGroupRequest::tunnel_dest_group].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_tunnel_dest_group<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TunnelDestGroup>,
        {
            self.0.request.tunnel_dest_group = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateTunnelDestGroupRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateTunnelDestGroupRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateTunnelDestGroup {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}

pub mod identity_aware_proxy_o_auth_service {
    use crate::Result;

    /// A builder for [IdentityAwareProxyOAuthService][crate::client::IdentityAwareProxyOAuthService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_iap_v1::*;
    /// # use builder::identity_aware_proxy_o_auth_service::ClientBuilder;
    /// # use client::IdentityAwareProxyOAuthService;
    /// let builder : ClientBuilder = IdentityAwareProxyOAuthService::builder();
    /// let client = builder
    ///     .with_endpoint("https://iap.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::IdentityAwareProxyOAuthService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = IdentityAwareProxyOAuthService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::IdentityAwareProxyOAuthService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::list_brands][crate::client::IdentityAwareProxyOAuthService::list_brands] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::ListBrands;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListBrands {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListBrands(RequestBuilder<crate::model::ListBrandsRequest>);

    impl ListBrands {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListBrandsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListBrandsResponse> {
            (*self.0.stub)
                .list_brands(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListBrandsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListBrands {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::create_brand][crate::client::IdentityAwareProxyOAuthService::create_brand] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::CreateBrand;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateBrand {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateBrand(RequestBuilder<crate::model::CreateBrandRequest>);

    impl CreateBrand {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateBrandRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Brand> {
            (*self.0.stub)
                .create_brand(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateBrandRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [brand][crate::model::CreateBrandRequest::brand].
        ///
        /// This is a **required** field for requests.
        pub fn set_brand<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Brand>,
        {
            self.0.request.brand = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [brand][crate::model::CreateBrandRequest::brand].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_brand<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Brand>,
        {
            self.0.request.brand = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateBrand {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::get_brand][crate::client::IdentityAwareProxyOAuthService::get_brand] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::GetBrand;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetBrand {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetBrand(RequestBuilder<crate::model::GetBrandRequest>);

    impl GetBrand {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetBrandRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Brand> {
            (*self.0.stub)
                .get_brand(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetBrandRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetBrand {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::create_identity_aware_proxy_client][crate::client::IdentityAwareProxyOAuthService::create_identity_aware_proxy_client] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::CreateIdentityAwareProxyClient;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateIdentityAwareProxyClient {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateIdentityAwareProxyClient(
        RequestBuilder<crate::model::CreateIdentityAwareProxyClientRequest>,
    );

    impl CreateIdentityAwareProxyClient {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateIdentityAwareProxyClientRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IdentityAwareProxyClient> {
            (*self.0.stub)
                .create_identity_aware_proxy_client(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateIdentityAwareProxyClientRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [identity_aware_proxy_client][crate::model::CreateIdentityAwareProxyClientRequest::identity_aware_proxy_client].
        ///
        /// This is a **required** field for requests.
        pub fn set_identity_aware_proxy_client<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IdentityAwareProxyClient>,
        {
            self.0.request.identity_aware_proxy_client = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [identity_aware_proxy_client][crate::model::CreateIdentityAwareProxyClientRequest::identity_aware_proxy_client].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_identity_aware_proxy_client<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::IdentityAwareProxyClient>,
        {
            self.0.request.identity_aware_proxy_client = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateIdentityAwareProxyClient {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::list_identity_aware_proxy_clients][crate::client::IdentityAwareProxyOAuthService::list_identity_aware_proxy_clients] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::ListIdentityAwareProxyClients;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListIdentityAwareProxyClients {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListIdentityAwareProxyClients(
        RequestBuilder<crate::model::ListIdentityAwareProxyClientsRequest>,
    );

    impl ListIdentityAwareProxyClients {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListIdentityAwareProxyClientsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListIdentityAwareProxyClientsResponse> {
            (*self.0.stub)
                .list_identity_aware_proxy_clients(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<
            crate::model::ListIdentityAwareProxyClientsResponse,
            gax::error::Error,
        > {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListIdentityAwareProxyClientsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListIdentityAwareProxyClientsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListIdentityAwareProxyClientsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListIdentityAwareProxyClientsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListIdentityAwareProxyClients {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::get_identity_aware_proxy_client][crate::client::IdentityAwareProxyOAuthService::get_identity_aware_proxy_client] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::GetIdentityAwareProxyClient;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIdentityAwareProxyClient {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIdentityAwareProxyClient(
        RequestBuilder<crate::model::GetIdentityAwareProxyClientRequest>,
    );

    impl GetIdentityAwareProxyClient {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetIdentityAwareProxyClientRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IdentityAwareProxyClient> {
            (*self.0.stub)
                .get_identity_aware_proxy_client(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetIdentityAwareProxyClientRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIdentityAwareProxyClient {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::reset_identity_aware_proxy_client_secret][crate::client::IdentityAwareProxyOAuthService::reset_identity_aware_proxy_client_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::ResetIdentityAwareProxyClientSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ResetIdentityAwareProxyClientSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ResetIdentityAwareProxyClientSecret(
        RequestBuilder<crate::model::ResetIdentityAwareProxyClientSecretRequest>,
    );

    impl ResetIdentityAwareProxyClientSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ResetIdentityAwareProxyClientSecretRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IdentityAwareProxyClient> {
            (*self.0.stub)
                .reset_identity_aware_proxy_client_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::ResetIdentityAwareProxyClientSecretRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ResetIdentityAwareProxyClientSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [IdentityAwareProxyOAuthService::delete_identity_aware_proxy_client][crate::client::IdentityAwareProxyOAuthService::delete_identity_aware_proxy_client] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iap_v1::builder;
    /// use builder::identity_aware_proxy_o_auth_service::DeleteIdentityAwareProxyClient;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteIdentityAwareProxyClient {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteIdentityAwareProxyClient(
        RequestBuilder<crate::model::DeleteIdentityAwareProxyClientRequest>,
    );

    impl DeleteIdentityAwareProxyClient {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::IdentityAwareProxyOAuthService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteIdentityAwareProxyClientRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_identity_aware_proxy_client(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteIdentityAwareProxyClientRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteIdentityAwareProxyClient {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
